let { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
  lintOnSave: false,
  transpileDependencies: true,
  outputDir: "dist",
  devServer: {
    // host: "localhost", 
    port: "8080", //端口号
    hot: true, //热更新自动刷新
    open: true, //自动打开
    proxy: {
      "/api": {
        // target: "http://82.156.69.136:8182", // 移除末尾的斜杠
        // target:'http://82.156.69.136:6001',
        target:'http://114.132.184.120:6001',
        // target: 'http://114.132.184.120:8182',
        changeOrigin: true,
        pathRewrite: {
          '^/api': '' // 这里保持为空字符串
        },
        // 添加以下配置以便调试
        onProxyReq(proxyReq, req, res) {
          // console.log('原始请求:', req.method, req.url);
        },
        onProxyRes(proxyRes, req, res) {
          // console.log('代理响应状态:', proxyRes.statusCode);
        }
      },
    },
    
  },
 
  
});
